﻿using System;

namespace NNTH
{
    public partial class MainForm : DevExpress.XtraEditors.XtraForm
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void MainForm_Load(object sender, EventArgs e)
        {
            var f = new fDangNhap();
            f.ShowDialog();
            if (f.DialogResult != System.Windows.Forms.DialogResult.OK)
            {
                this.Close();
            }
        }

        private void btDoiTuong_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fDoiTuong();
            f.MdiParent = this;
            f.Show();
        }

        private void btKhoaHoc_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fKhoaHoc();
            f.MdiParent = this;
            f.Show();
        }

        private void btLopHoc_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fLopHoc();
            f.MdiParent = this;
            f.Show();
        }

        private void btMonHoc_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fMonHoc();
            f.MdiParent = this;
            f.Show();
        }

        private void btHocVien_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fHocVien();
            f.MdiParent = this;
            f.Show();
        }

        private void btTiepNhan_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {

        }

        private void btBangDiem_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fBangDiem();
            f.MdiParent = this;
            f.Show();
        }

        private void btHopDong_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {

        }

        private void navGiaoVien_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fGiaoVien();
            f.MdiParent = this;
            f.Show();
        }

        private void btHuyHD_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {

        }

        private void btKHHT_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fKeHoachHT();
            f.MdiParent = this;
            f.Show();
        }

        private void xtraTab_PageAdded(object sender, DevExpress.XtraTabbedMdi.MdiTabPageEventArgs e)
        {
            if (xtraTab.Pages.Count>=1)
            {
                pictureEdit1.Visible = false;
            }
        }

        private void xtraTab_PageRemoved(object sender, DevExpress.XtraTabbedMdi.MdiTabPageEventArgs e)
        {
            if (xtraTab.Pages.Count ==0)
            {
                pictureEdit1.Visible = true;
            }
        }

        private void navBarItem3_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fPhong();
            f.MdiParent = this;
            f.Show();
        }

        private void navBarItem4_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fXepPhongThi();
            f.MdiParent = this;
            f.Show();
        }

        private void navBangDiemLop_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fBangDiemLop();
            f.MdiParent = this;
            f.Show();
        }

        private void navBangdiemHV_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            var f = new fBangDiemHV();
            f.MdiParent = this;
            f.Show();
        }

        private void navInBang_LinkClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {

        }
    }
}